<template>
	<view class="content">
		<button @click="open">Open Calendar</button>
		<wxh-calendar-date-picker ref="datePiker" @pickSuccess="pickSuccess" title="日期选择器" :holidays="holidays"
			:weekendCanPick="true" :holidayCanPick="true" :lostdayCanPick="false" :beginDate="beginDate"
			:maxMonth="2" />
		<text>date:{{date}}</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				date: null, //选择日期
				holidays: ['2024-3-15', '2024-3-17'], //休息日数组
				beginDate: new Date(), //最早可选日期为当前日期
			}
		},
		methods: {
			open() {
				this.$refs.datePiker.show();
			},
			pickSuccess(date) {
				this.date = date;
				console.log('date', date)
				uni.navigateTo({
					url: '/pages/index/xieyi?dates=' + date
				})
			}
		}
	}
</script>

<style lang="scss">

</style>